<html>
<head><meta charset="utf-8"><title>More granular debug info generation · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/More.20granular.20debug.20info.20generation.html">More granular debug info generation</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="222454399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/More%20granular%20debug%20info%20generation/near/222454399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kevin Tran <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/More.20granular.20debug.20info.20generation.html#222454399">(Jan 12 2021 at 16:15)</a>:</h4>
<p>Suppose you are trying to understand what is going in a function. I would attach a debugger and inspect the variables to give me a feel of what kind of data is being handled by the function. However, setting <code>debuginfo-level=2</code>in config.toml results in a very slow build. Is there a way to limit the full info to just the rustc_mir crate for example? If this is not an option, what else could I do to inspect the variables other than print debugging?</p>



<a name="222454698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/More%20granular%20debug%20info%20generation/near/222454698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/More.20granular.20debug.20info.20generation.html#222454698">(Jan 12 2021 at 16:18)</a>:</h4>
<p>mostly I just use print debugging <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="222454773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/More%20granular%20debug%20info%20generation/near/222454773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/More.20granular.20debug.20info.20generation.html#222454773">(Jan 12 2021 at 16:18)</a>:</h4>
<p>I wonder if you could tell cargo to only add debuginfo to certain crates <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="222455124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/More%20granular%20debug%20info%20generation/near/222455124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/More.20granular.20debug.20info.20generation.html#222455124">(Jan 12 2021 at 16:21)</a>:</h4>
<p>maybe something like <code>[profile.release] debuginfo = 2</code>, but only in the crate you're interested in</p>



<a name="222455805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/More%20granular%20debug%20info%20generation/near/222455805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/More.20granular.20debug.20info.20generation.html#222455805">(Jan 12 2021 at 16:25)</a>:</h4>
<p>That would be <code>[profile.release.package.crate-name] debuginfo = 2</code> in the top-level <code>Cargo.toml</code>. Only the top-level <code>Cargo.toml</code> is read when determining compilation profiles. If you put it in any other <code>Cargo.toml</code> you will get a warning.</p>



<a name="222461730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/More%20granular%20debug%20info%20generation/near/222461730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kevin Tran <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/More.20granular.20debug.20info.20generation.html#222461730">(Jan 12 2021 at 17:01)</a>:</h4>
<p>it seems like rustc_mir isn't a top level crate. can i still limit <code>debuginfo = 2</code> to only the rustc_mir crate?</p>



<a name="222461987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/More%20granular%20debug%20info%20generation/near/222461987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/More.20granular.20debug.20info.20generation.html#222461987">(Jan 12 2021 at 17:03)</a>:</h4>
<p><span class="user-mention" data-user-id="351526">@Kevin Tran</span> yes, put the override in the top-level cargo.toml, but replace <code>crate-name</code> with <code>rustc_mir</code></p>



<a name="222462622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/More%20granular%20debug%20info%20generation/near/222462622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kevin Tran <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/More.20granular.20debug.20info.20generation.html#222462622">(Jan 12 2021 at 17:06)</a>:</h4>
<p>i get the warning <code>warning: /home/kt/stow/src/src/rust/Cargo.toml: unused manifest key: profile.release.package.rustc_mir.debuginfo</code> though. is this ok? <span class="user-mention" data-user-id="232545">@Joshua Nelson</span></p>



<a name="222465610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/More%20granular%20debug%20info%20generation/near/222465610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/More.20granular.20debug.20info.20generation.html#222465610">(Jan 12 2021 at 17:26)</a>:</h4>
<p>It should be <code>debug = 2</code>, not <code>debuginfo = 2</code> I think.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>